﻿<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
	<title>测试微信小程序支付</title>
	<style type="text/css">
		form { padding: 10px; background: #f5f5f5; border: 1px solid #EEEEEE; }
		input { padding: 10px; border: 1px solid #ccc; }
	</style>
</head>
<body>
<!--<form action="/api/xcx/user/head/upload" method="post" enctype="multipart/form-data">-->
	<!--<div>测试微信小程序支付</div>-->
	<!--<input type="text" name="phone" value="15050505050"/>-->
	<!--<input type="file" name="head"/>-->
	<!--<input type="submit" value="上传"/>-->
<!--</form>-->
</body>
</html>


<script type="text/javascript" src="../admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
	(function () {
		dopay();
	})();
	function dopay(){
		var formData = {
//			appid: 'wx79f1ec62a1d56e81',
//			mchid: '1649023602',
//			description: '用户充值',
//			out_trade_no: Date.now(),
//			notify_url: '',
//			amount: {
//				total: 1
//			},
//			payer: {
//				openid: ''
//			},
//			detail: {
//				goods_detail: {
//					merchant_goods_id: '123456',
//					quantity: 1,
//					unit_price: 0.01
//				}
//			},
//			scene_info: {
//				payer_client_ip: '',
//				store_info: {
//					id: ''
//				}
//			}
			////////////////////////
			"mchid": "1900006XXX",
			"out_trade_no": "1217752501201407033233368318",
			"appid": "wxdace645e0bc2cXXX",
			"description": "Image形象店-深圳腾大-QQ公仔",
			"notify_url": "https://www.weixin.qq.com/wxpay/pay.php",
			"amount": {
				"total": 1,
				"currency": "CNY"
			},
			"payer": {
				"openid": "o4GgauInH_RCEdvrrNGrntXDuXXX"
			}
		};
		$.ajax({
			type: 'post',
			url: 'https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi',
			data: formData,
			success: function (res) {
				console.log(res);
			},
			error: function () {
				console.log('错误啦');
			}
		});
	}
</script>